﻿using System;
using System.Configuration;
using System.Windows.Forms;
using System.Web;

namespace OpenCost.OutputPlugin.GooglePowerMeter
{
    public partial class Config : Form
    {
        public Config()
        {
            InitializeComponent();
            txtAuthKey.Text= HttpUtility.HtmlDecode(ConfigurationManager.AppSettings.Get("GoogleAuthKey"));
        }

        private void BtnCancelClick(object sender, EventArgs e)
        {
            Close();
        }

        private void BtnSaveClick(object sender, EventArgs e)
        {
            ConfigurationManager.AppSettings["GoogleAuthKey"] = HttpUtility.HtmlEncode(txtAuthKey.Text);
            Close();
        }
    }
}
